<%@ page language="java"
	import="java.util.*,com.biz.model.common.SessionInfo,com.biz.utils.ConfigUtil"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="keywords" content="">
<meta name="description" content="">
<title>修改密码</title>
<jsp:include page="../inc.jsp"></jsp:include>
</head>
<script type="text/javascript">
  $(document).ready(function(){
	$("#form").bind("submit", function(){
		var flag = false;
		var msg = "";
		var pw = document.getElementById("user_pwd_oldPwd").value;
		var pw1 = document.getElementById("psw").value;
		var pw2 = document.getElementById("repwd").value;
              
		if(pw !="" && pw1 !="" && pw2 == pw1){
          	flag = true;
         }
		if(pw ==""){
			$("#tishi").html("*");
			$("#tishi1").html("*");
			$("#yuanmima").html("请输入原密码！");
		}else if(pw1 !=  pw2){
			$("#yuanmima").html("*");
			$("#tishi1").html("*");
			document.getElementById("tishi").innerHTML="<font color='red'>两次密码不相同</font>";
		}else if(pw1 == "" && pw2 == ""){
			$("#yuanmima").html("*");
			$("#tishi").html("*");
			document.getElementById("tishi1").innerHTML="<font color='red'>请输入新密码</font>";	
		}
             return flag;
		});
});
  
  
function checkPassword(){
		var pwd=$("#user_pwd_oldPwd").val();
		
		$.ajax({  
            	  url : '${pageContext.request.contextPath}/user/checkpwd.action',  
                  data:{pwds:pwd},  
                  dataType: 'json', 
                  success : function(r) { 
                      if (!r) {  
                      	  $("#tishi").html("*");
							$("#tishi1").html("*");
							$("#yuanmima").html("原密码不正确！");
                    	  $("#user_pwd_oldPwd").val('');
                    	  
                  		}
                  }
		});
	}


</script>
<body>
<form id="form" action="${pageContext.request.contextPath}/shopInfo/changePsw.action">
    <div class="hdzl-xgmm">
        <div class="zh_xbj">
            <label>旧密码：</label>
            <input type="password"  id="user_pwd_oldPwd" name="puser.pwd" class="zh_hdname" missingMessage="请填写原来的密码" > <span id ="yuanmima" class="colred">*</span>
        </div>
        <div class="zh_xbj">
            <label>新密码：</label>
            <input type="password" name="puser.newpwd" id="psw" class="zh_hdname" value=""> <span id="tishi1" class="colred">*</span>
        </div>
        <div class="zh_xbj">
            <label>确定新密码：</label>
            <input type="password" name="puser.repwd" id="repwd" onkeyup="validate()"  class="zh_hdname" value=""> <span id="tishi" class="colred">*</span>
        </div>
        <input type="submit"  value="确定" class="xgmm-qdbtn">
        <input type="reset" value="重置" class="xgmm-retbtn">
    </div>
</form>

</body>
</html>